window.onload = function () {
    var header = document.querySelector('header');
    var xhr = new XMLHttpRequest();
    xhr.open('GET', 'myheader.html');
    xhr.send();
    xhr.onreadystatechange = function () {
        if (xhr.readyState == 4 && xhr.status == 200) {
            header.innerHTML = xhr.responseText;
        }
    }
}